<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <title>订单详情</title>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
        <meta name="description" content="">
        <meta name="author" content="">

        <title>Dashboard Template for Bootstrap</title>
        <!-- Bootstrap core CSS -->
        <link href="asserts/css/bootstrap.min.css" th:href="@{/webjars/bootstrap/4.0.0/css/bootstrap.css}" rel="stylesheet">

        <!-- Custom styles for this template -->
        <link href="asserts/css/dashboard.css" th:href="@{/asserts/css/dashboard.css}" rel="stylesheet">
        <style type="text/css">
            /* Chart.js */

            @-webkit-keyframes chartjs-render-animation {
                from {
                    opacity: 0.99
                }
                to {
                    opacity: 1
                }
            }

            @keyframes chartjs-render-animation {
                from {
                    opacity: 0.99
                }
                to {
                    opacity: 1
                }
            }

            .chartjs-render-monitor {
                -webkit-animation: chartjs-render-animation 0.001s;
                animation: chartjs-render-animation 0.001s;
            }
            table {
                width: 100%;
                height: 100%;
                border: 1px solid green;
                margin: auto;
                margin-top: 50px;
            }
        </style>
    </head>
</head>
<body bgcolor="#C7C7E2">
    <div class="container-fluid">
        <a th:href="@{/lmh(username=${order.get(0).getBuyerName()})}"> 返回主界面</a>
        <div class="row">
            <main role="main" class="col-md-9 ml-sm-auto col-lg-10 pt-3 px-4">
                <div class="table-responsive">
                    <table class="table table-striped table-sm">
                        <thead>
                        <tr>
                            <th>订单id</th>
                            <th>姓名</th>
                            <th>手机号</th>
                            <th>金额</th>
                            <th>订单状态</th>
                            <th>支付状态</th>
                            <th>创建时间</th>
                        </tr>
                        </thead>
                        <tbody>
                        <tr th:each="emp:${order}">
                            <td th:text="${emp.getOrderId()}"></td>
                            <td th:text="${emp.getBuyerName()}"></td>
                            <td th:text="${emp.getBuyerPhone()}"></td>
                            <td th:text="${emp.getOrderAmount()}"></td>
                            <td th:switch="${emp.getOrderStatus()}">
                                <p th:case="0">新订单</p>
                                <p th:case="1">完结</p>
                                <p th:case="2">已取消</p>
                            </td>
                            <td th:switch="${emp.getPayStatus()}">
                                <p th:case="0">等待支付</p>
                                <p th:case="1">支付成功</p>
                            </td>
                            <td th:text="${#dates.format(emp.getCreateTime(), 'yyyy-MM-dd HH:mm')}"></td>
                            <td>
                                <a class="btn btn-sm btn-primary" th:href="@{/delete(id=${emp.getOrderId()})}" >删除订单</a>
                                <a class="btn btn-sm btn-primary" th:href="@{/detail(id=${emp.getOrderId()})}" >订单详情</a>
                            </td>
                        </tr>
                        </tbody>
                    </table>
                </div>
            </main>
        </div>
    </div>
</body>
</html>